/**
 * Created by PanJiaChen on 16/11/18.
 */

/**
 * @param {string} path
 * @returns {Boolean}
 */
export function isExternal(path) {
  return /^(https?:|mailto:|tel:)/.test(path)
}

/**
 * @param {string} str
 * @returns {Boolean}
 */
export function validUsername(str) {
  const valid_map = ['17605048999', 'editor']
  return valid_map.indexOf(str.trim()) >= 0
}
/**
 * 手机号码校验
 */
export function validPhoneNumber(value) {
  if (value === '' || value && (!(/^[1][34578]\d{9}$/).test(value) || !(/^[1-9]\d*$/).test(value) || value.length !== 11)) {
    return false
  }
  return true
}
